import Rectangle from './Rectangle'

// const landDom = document.querySelector('.land')
// const landStyles = getComputedStyle(landDom)
// const landWidth = parseFloat(landStyles.width)
// const landHeight = parseFloat(landStyles.height)
// const landTop = parseFloat(landStyles.top)

class Land extends Rectangle {
  constructor(speed, landDom) {
    const landStyles = getComputedStyle(landDom)
    const landWidth = parseFloat(landStyles.width)
    const landHeight = parseFloat(landStyles.height)
    const landTop = parseFloat(landStyles.top)
    super(landWidth, landHeight, 0, landTop, speed, 0, landDom)
  }

  onMove() {
    if (this.left <= -this.width / 2) {
      this.left = 0
    }
  }
}

export default Land
